<?php
/* @var $this TopicController */
/* @var $model Topic */

$this->breadcrumbs=array(
	'Topics'=>array('index'),
	$model->title,
);

$this->menu=array(
        array('label'=>'Manage Topic', 'url'=>array('admin')),
	array('label'=>'Create Topic', 'url'=>array('create')),
	array('label'=>'Update Topic', 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>'Delete Topic', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),	
);
?>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
                array(
                    'name'=>'imageId',
                    'type'=>'raw',
                    'value'=>$model->avatar?CHtml::image(Yii::app()->baseUrl . '/' . $model->avatar->url, '', array('width'=>100, 'height'=>100)):''
                ),
		'title',
		array(
                    'name'=>'content',
                    'type'=>'raw'
                ),
                array(
                    'name'=>'categoryId',
                    'value'=>  TopicCategory::model()->findByPk($model->categoryId)->name
                ),
                array(
                    'name'=>'upload',
                    'type'=>'raw',
                    'value'=>$model->attachment?CHtml::link($model->attachment->name, Yii::app()->baseUrl . '/' . $model->attachment->url):''
                ),
                array(
                    'name'=>'status',
                    'value'=>$model->status?Yii::t('main', 'Visible'):Yii::t('main', 'Hidden')
                ),
                array(
                    'name'=>'createTime',
                    'value'=>date("Y-m-d H:i:s", $model->createTime),
                ),
	),
)); ?>
